<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        /* number,string,boolean  */
        /*  1.string,boolean -->number
        Number()  --强制转换
        parseInt()
        parseFloat()
         */
        var a="12";
        var num=Number(a);
        var str="12px"
        console.log(typeof num)   //number(typeof:查看类型)
        console.log(num)         //12
        console.log(a)           //12
        console.log(Number(str))  //NaN （not a Number）  不是一个数字
        /* NaN和任何类型做运算返回的结果都是NaN */
    </script>
</body>
</html>